package Solutions

import "sort"

func maxIceCream(costs []int, coins int) int {
	sort.Ints(costs)
	ans := 0
	for i := 0; i < len(costs) && coins >= costs[i]; i++ {
		coins -= costs[i]

		ans += 1
	}
	return ans
}
